package com.gouying.design.patterns.adapter;

import javax.sound.midi.MidiDevice;

public class AdvancedAdapter implements MediaPlayer {

    private AdvancedMediaPlayer advancedMediaPlayer;

    private Mp3MediaPlayerImpl mp3MediaPlayer;

    @Override
    public void play(String audioType, String fileName) {
        if(audioType.equalsIgnoreCase("vlc")) {
            advancedMediaPlayer = new ClvMediaPlayer();
            advancedMediaPlayer.playVlc(fileName);
        }else if(audioType.equalsIgnoreCase("mp4")) {
            advancedMediaPlayer = new Mp4MediaPlayer();
            advancedMediaPlayer.playMp4(fileName);
        }else {
            mp3MediaPlayer.play(audioType, fileName);
        }
    }

}
